3.45 \(\int (c+d x)^2 (a+b \tan (e+f x))^2 \, dx\)

Optimal. Leaf size=229 \[ \frac{2 i a b d (c+d x) \text{PolyLog}\left (2,-e^{2 i (e+f x)}\right )}{f^2}-\frac{a b d^2 \text{PolyLog}\left (3,-e^{2 i (e+f x)}\right )}{f^3}-\frac{i b^2 d^2 \text{PolyLog}\left (2,-e^{2 i (e+f x)}\right )}{f^3}+\frac{a^2 (c+d x)^3}{3 d}-\frac{2 a b (c+d x)^2 \log \left (1+e^{2 i (e+f x)}\right )}{f}+\frac{2 i a b (c+d x)^3}{3 d}+\frac{2 b^2 d (c+d x) \log \left (1+e^{2 i (e+f x)}\right )}{f^2}+\frac{b^2 (c+d x)^2 \tan (e+f x)}{f}-\frac{i b^2 (c+d x)^2}{f}-\frac{b^2 (c+d x)^3}{3 d} \]

[Out]

((-I)*b^2*(c + d*x)^2)/f + (a^2*(c + d*x)^3)/(3*d) + (((2*I)/3)*a*b*(c + d*x)^3)/d - (b^2*(c + d*x)^3)/(3*d) +
 (2*b^2*d*(c + d*x)*Log[1 + E^((2*I)*(e + f*x))])/f^2 - (2*a*b*(c + d*x)^2*Log[1 + E^((2*I)*(e + f*x))])/f - (
I*b^2*d^2*PolyLog[2, -E^((2*I)*(e + f*x))])/f^3 + ((2*I)*a*b*d*(c + d*x)*PolyLog[2, -E^((2*I)*(e + f*x))])/f^2
 - (a*b*d^2*PolyLog[3, -E^((2*I)*(e + f*x))])/f^3 + (b^2*(c + d*x)^2*Tan[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.412394, antiderivative size = 229, normalized size of antiderivative = 1., number of steps used = 13, number of rules used = 10, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {3722, 3719, 2190, 2531, 2282, 6589, 3720, 2279, 2391, 32} \[ \frac{a^2 (c+d x)^3}{3 d}+\frac{2 i a b d (c+d x) \text{Li}_2\left (-e^{2 i (e+f x)}\right )}{f^2}-\frac{2 a b (c+d x)^2 \log \left (1+e^{2 i (e+f x)}\right )}{f}+\frac{2 i a b (c+d x)^3}{3 d}-\frac{a b d^2 \text{Li}_3\left (-e^{2 i (e+f x)}\right )}{f^3}+\frac{2 b^2 d (c+d x) \log \left (1+e^{2 i (e+f x)}\right )}{f^2}+\frac{b^2 (c+d x)^2 \tan (e+f x)}{f}-\frac{i b^2 (c+d x)^2}{f}-\frac{b^2 (c+d x)^3}{3 d}-\frac{i b^2 d^2 \text{Li}_2\left (-e^{2 i (e+f x)}\right )}{f^3} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*x)^2*(a + b*Tan[e + f*x])^2,x]

[Out]

((-I)*b^2*(c + d*x)^2)/f + (a^2*(c + d*x)^3)/(3*d) + (((2*I)/3)*a*b*(c + d*x)^3)/d - (b^2*(c + d*x)^3)/(3*d) +
 (2*b^2*d*(c + d*x)*Log[1 + E^((2*I)*(e + f*x))])/f^2 - (2*a*b*(c + d*x)^2*Log[1 + E^((2*I)*(e + f*x))])/f - (
I*b^2*d^2*PolyLog[2, -E^((2*I)*(e + f*x))])/f^3 + ((2*I)*a*b*d*(c + d*x)*PolyLog[2, -E^((2*I)*(e + f*x))])/f^2
 - (a*b*d^2*PolyLog[3, -E^((2*I)*(e + f*x))])/f^3 + (b^2*(c + d*x)^2*Tan[e + f*x])/f

Rule 3722

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[ExpandIntegrand[
(c + d*x)^m, (a + b*Tan[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]

Rule 3719

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(I*(c + d*x)^(m + 1))/(d*(m + 1)), x
] - Dist[2*I, Int[((c + d*x)^m*E^(2*I*(e + f*x)))/(1 + E^(2*I*(e + f*x))), x], x] /; FreeQ[{c, d, e, f}, x] &&
 IGtQ[m, 0]

Rule 2190

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m*Log[1 + (b*(F^(g*(e + f*x)))^n)/a])/(b*f*g*n*Log[F]), x]
 - Dist[(d*m)/(b*f*g*n*Log[F]), Int[(c + d*x)^(m - 1)*Log[1 + (b*(F^(g*(e + f*x)))^n)/a], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2531

Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> -Simp[((
f + g*x)^m*PolyLog[2, -(e*(F^(c*(a + b*x)))^n)])/(b*c*n*Log[F]), x] + Dist[(g*m)/(b*c*n*Log[F]), Int[(f + g*x)
^(m - 1)*PolyLog[2, -(e*(F^(c*(a + b*x)))^n)], x], x] /; FreeQ[{F, a, b, c, e, f, g, n}, x] && GtQ[m, 0]

Rule 2282

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 6589

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rule 3720

Int[((c_.) + (d_.)*(x_))^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(c + d*x)^m*(b*Tan[e
 + f*x])^(n - 1))/(f*(n - 1)), x] + (-Dist[(b*d*m)/(f*(n - 1)), Int[(c + d*x)^(m - 1)*(b*Tan[e + f*x])^(n - 1)
, x], x] - Dist[b^2, Int[(c + d*x)^m*(b*Tan[e + f*x])^(n - 2), x], x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n,
1] && GtQ[m, 0]

Rule 2279

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rubi steps

\begin{align*} \int (c+d x)^2 (a+b \tan (e+f x))^2 \, dx &=\int \left (a^2 (c+d x)^2+2 a b (c+d x)^2 \tan (e+f x)+b^2 (c+d x)^2 \tan ^2(e+f x)\right ) \, dx\\ &=\frac{a^2 (c+d x)^3}{3 d}+(2 a b) \int (c+d x)^2 \tan (e+f x) \, dx+b^2 \int (c+d x)^2 \tan ^2(e+f x) \, dx\\ &=\frac{a^2 (c+d x)^3}{3 d}+\frac{2 i a b (c+d x)^3}{3 d}+\frac{b^2 (c+d x)^2 \tan (e+f x)}{f}-(4 i a b) \int \frac{e^{2 i (e+f x)} (c+d x)^2}{1+e^{2 i (e+f x)}} \, dx-b^2 \int (c+d x)^2 \, dx-\frac{\left (2 b^2 d\right ) \int (c+d x) \tan (e+f x) \, dx}{f}\\ &=-\frac{i b^2 (c+d x)^2}{f}+\frac{a^2 (c+d x)^3}{3 d}+\frac{2 i a b (c+d x)^3}{3 d}-\frac{b^2 (c+d x)^3}{3 d}-\frac{2 a b (c+d x)^2 \log \left (1+e^{2 i (e+f x)}\right )}{f}+\frac{b^2 (c+d x)^2 \tan (e+f x)}{f}+\frac{(4 a b d) \int (c+d x) \log \left (1+e^{2 i (e+f x)}\right ) \, dx}{f}+\frac{\left (4 i b^2 d\right ) \int \frac{e^{2 i (e+f x)} (c+d x)}{1+e^{2 i (e+f x)}} \, dx}{f}\\ &=-\frac{i b^2 (c+d x)^2}{f}+\frac{a^2 (c+d x)^3}{3 d}+\frac{2 i a b (c+d x)^3}{3 d}-\frac{b^2 (c+d x)^3}{3 d}+\frac{2 b^2 d (c+d x) \log \left (1+e^{2 i (e+f x)}\right )}{f^2}-\frac{2 a b (c+d x)^2 \log \left (1+e^{2 i (e+f x)}\right )}{f}+\frac{2 i a b d (c+d x) \text{Li}_2\left (-e^{2 i (e+f x)}\right )}{f^2}+\frac{b^2 (c+d x)^2 \tan (e+f x)}{f}-\frac{\left (2 i a b d^2\right ) \int \text{Li}_2\left (-e^{2 i (e+f x)}\right ) \, dx}{f^2}-\frac{\left (2 b^2 d^2\right ) \int \log \left (1+e^{2 i (e+f x)}\right ) \, dx}{f^2}\\ &=-\frac{i b^2 (c+d x)^2}{f}+\frac{a^2 (c+d x)^3}{3 d}+\frac{2 i a b (c+d x)^3}{3 d}-\frac{b^2 (c+d x)^3}{3 d}+\frac{2 b^2 d (c+d x) \log \left (1+e^{2 i (e+f x)}\right )}{f^2}-\frac{2 a b (c+d x)^2 \log \left (1+e^{2 i (e+f x)}\right )}{f}+\frac{2 i a b d (c+d x) \text{Li}_2\left (-e^{2 i (e+f x)}\right )}{f^2}+\frac{b^2 (c+d x)^2 \tan (e+f x)}{f}-\frac{\left (a b d^2\right ) \operatorname{Subst}\left (\int \frac{\text{Li}_2(-x)}{x} \, dx,x,e^{2 i (e+f x)}\right )}{f^3}+\frac{\left (i b^2 d^2\right ) \operatorname{Subst}\left (\int \frac{\log (1+x)}{x} \, dx,x,e^{2 i (e+f x)}\right )}{f^3}\\ &=-\frac{i b^2 (c+d x)^2}{f}+\frac{a^2 (c+d x)^3}{3 d}+\frac{2 i a b (c+d x)^3}{3 d}-\frac{b^2 (c+d x)^3}{3 d}+\frac{2 b^2 d (c+d x) \log \left (1+e^{2 i (e+f x)}\right )}{f^2}-\frac{2 a b (c+d x)^2 \log \left (1+e^{2 i (e+f x)}\right )}{f}-\frac{i b^2 d^2 \text{Li}_2\left (-e^{2 i (e+f x)}\right )}{f^3}+\frac{2 i a b d (c+d x) \text{Li}_2\left (-e^{2 i (e+f x)}\right )}{f^2}-\frac{a b d^2 \text{Li}_3\left (-e^{2 i (e+f x)}\right )}{f^3}+\frac{b^2 (c+d x)^2 \tan (e+f x)}{f}\\ \end{align*}

Mathematica [B]  time = 7.09602, size = 649, normalized size = 2.83 \[ -\frac{2 a b c d \csc (e) \sec (e) \left (f^2 x^2 e^{-i \tan ^{-1}(\cot (e))}-\frac{\cot (e) \left (i \text{PolyLog}\left (2,e^{2 i \left (f x-\tan ^{-1}(\cot (e))\right )}\right )+i f x \left (-2 \tan ^{-1}(\cot (e))-\pi \right )-2 \left (f x-\tan ^{-1}(\cot (e))\right ) \log \left (1-e^{2 i \left (f x-\tan ^{-1}(\cot (e))\right )}\right )-2 \tan ^{-1}(\cot (e)) \log \left (\sin \left (f x-\tan ^{-1}(\cot (e))\right )\right )-\pi \log \left (1+e^{-2 i f x}\right )+\pi \log (\cos (f x))\right )}{\sqrt{\cot ^2(e)+1}}\right )}{f^2 \sqrt{\csc ^2(e) \left (\sin ^2(e)+\cos ^2(e)\right )}}-\frac{i a b d^2 e^{-i e} \sec (e) \left (6 \left (1+e^{2 i e}\right ) f x \text{PolyLog}\left (2,-e^{-2 i (e+f x)}\right )-3 i \left (1+e^{2 i e}\right ) \text{PolyLog}\left (3,-e^{-2 i (e+f x)}\right )+2 f^2 x^2 \left (2 f x-3 i \left (1+e^{2 i e}\right ) \log \left (1+e^{-2 i (e+f x)}\right )\right )\right )}{6 f^3}+\frac{b^2 d^2 \csc (e) \sec (e) \left (f^2 x^2 e^{-i \tan ^{-1}(\cot (e))}-\frac{\cot (e) \left (i \text{PolyLog}\left (2,e^{2 i \left (f x-\tan ^{-1}(\cot (e))\right )}\right )+i f x \left (-2 \tan ^{-1}(\cot (e))-\pi \right )-2 \left (f x-\tan ^{-1}(\cot (e))\right ) \log \left (1-e^{2 i \left (f x-\tan ^{-1}(\cot (e))\right )}\right )-2 \tan ^{-1}(\cot (e)) \log \left (\sin \left (f x-\tan ^{-1}(\cot (e))\right )\right )-\pi \log \left (1+e^{-2 i f x}\right )+\pi \log (\cos (f x))\right )}{\sqrt{\cot ^2(e)+1}}\right )}{f^3 \sqrt{\csc ^2(e) \left (\sin ^2(e)+\cos ^2(e)\right )}}+\frac{1}{3} x \sec (e) \left (3 c^2+3 c d x+d^2 x^2\right ) \left (a^2 \cos (e)+2 a b \sin (e)-b^2 \cos (e)\right )-\frac{2 a b c^2 \sec (e) (f x \sin (e)+\cos (e) \log (\cos (e) \cos (f x)-\sin (e) \sin (f x)))}{f \left (\sin ^2(e)+\cos ^2(e)\right )}+\frac{\sec (e) \sec (e+f x) \left (b^2 c^2 \sin (f x)+2 b^2 c d x \sin (f x)+b^2 d^2 x^2 \sin (f x)\right )}{f}+\frac{2 b^2 c d \sec (e) (f x \sin (e)+\cos (e) \log (\cos (e) \cos (f x)-\sin (e) \sin (f x)))}{f^2 \left (\sin ^2(e)+\cos ^2(e)\right )} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[(c + d*x)^2*(a + b*Tan[e + f*x])^2,x]

[Out]

((-I/6)*a*b*d^2*(2*f^2*x^2*(2*f*x - (3*I)*(1 + E^((2*I)*e))*Log[1 + E^((-2*I)*(e + f*x))]) + 6*(1 + E^((2*I)*e
))*f*x*PolyLog[2, -E^((-2*I)*(e + f*x))] - (3*I)*(1 + E^((2*I)*e))*PolyLog[3, -E^((-2*I)*(e + f*x))])*Sec[e])/
(E^(I*e)*f^3) + (x*(3*c^2 + 3*c*d*x + d^2*x^2)*Sec[e]*(a^2*Cos[e] - b^2*Cos[e] + 2*a*b*Sin[e]))/3 + (2*b^2*c*d
*Sec[e]*(Cos[e]*Log[Cos[e]*Cos[f*x] - Sin[e]*Sin[f*x]] + f*x*Sin[e]))/(f^2*(Cos[e]^2 + Sin[e]^2)) - (2*a*b*c^2
*Sec[e]*(Cos[e]*Log[Cos[e]*Cos[f*x] - Sin[e]*Sin[f*x]] + f*x*Sin[e]))/(f*(Cos[e]^2 + Sin[e]^2)) + (b^2*d^2*Csc
[e]*((f^2*x^2)/E^(I*ArcTan[Cot[e]]) - (Cot[e]*(I*f*x*(-Pi - 2*ArcTan[Cot[e]]) - Pi*Log[1 + E^((-2*I)*f*x)] - 2
*(f*x - ArcTan[Cot[e]])*Log[1 - E^((2*I)*(f*x - ArcTan[Cot[e]]))] + Pi*Log[Cos[f*x]] - 2*ArcTan[Cot[e]]*Log[Si
n[f*x - ArcTan[Cot[e]]]] + I*PolyLog[2, E^((2*I)*(f*x - ArcTan[Cot[e]]))]))/Sqrt[1 + Cot[e]^2])*Sec[e])/(f^3*S
qrt[Csc[e]^2*(Cos[e]^2 + Sin[e]^2)]) - (2*a*b*c*d*Csc[e]*((f^2*x^2)/E^(I*ArcTan[Cot[e]]) - (Cot[e]*(I*f*x*(-Pi
 - 2*ArcTan[Cot[e]]) - Pi*Log[1 + E^((-2*I)*f*x)] - 2*(f*x - ArcTan[Cot[e]])*Log[1 - E^((2*I)*(f*x - ArcTan[Co
t[e]]))] + Pi*Log[Cos[f*x]] - 2*ArcTan[Cot[e]]*Log[Sin[f*x - ArcTan[Cot[e]]]] + I*PolyLog[2, E^((2*I)*(f*x - A
rcTan[Cot[e]]))]))/Sqrt[1 + Cot[e]^2])*Sec[e])/(f^2*Sqrt[Csc[e]^2*(Cos[e]^2 + Sin[e]^2)]) + (Sec[e]*Sec[e + f*
x]*(b^2*c^2*Sin[f*x] + 2*b^2*c*d*x*Sin[f*x] + b^2*d^2*x^2*Sin[f*x]))/f

________________________________________________________________________________________

Maple [B]  time = 0.109, size = 542, normalized size = 2.4 \begin{align*}{\frac{-i{b}^{2}{d}^{2}{\it polylog} \left ( 2,-{{\rm e}^{2\,i \left ( fx+e \right ) }} \right ) }{{f}^{3}}}-2\,iab{c}^{2}x-{\frac{ab{d}^{2}{\it polylog} \left ( 3,-{{\rm e}^{2\,i \left ( fx+e \right ) }} \right ) }{{f}^{3}}}+{a}^{2}cd{x}^{2}+{\frac{8\,ibacdex}{f}}-{\frac{2\,i{b}^{2}{d}^{2}{e}^{2}}{{f}^{3}}}-{\frac{2\,i{b}^{2}{d}^{2}{x}^{2}}{f}}+{\frac{2\,i}{3}}ab{d}^{2}{x}^{3}+2\,{\frac{{b}^{2}{d}^{2}\ln \left ({{\rm e}^{2\,i \left ( fx+e \right ) }}+1 \right ) x}{{f}^{2}}}-2\,{\frac{ab{c}^{2}\ln \left ({{\rm e}^{2\,i \left ( fx+e \right ) }}+1 \right ) }{f}}+4\,{\frac{ab{c}^{2}\ln \left ({{\rm e}^{i \left ( fx+e \right ) }} \right ) }{f}}+2\,{\frac{{b}^{2}cd\ln \left ({{\rm e}^{2\,i \left ( fx+e \right ) }}+1 \right ) }{{f}^{2}}}-4\,{\frac{{b}^{2}cd\ln \left ({{\rm e}^{i \left ( fx+e \right ) }} \right ) }{{f}^{2}}}+4\,{\frac{{b}^{2}{d}^{2}e\ln \left ({{\rm e}^{i \left ( fx+e \right ) }} \right ) }{{f}^{3}}}+4\,{\frac{ab{d}^{2}{e}^{2}\ln \left ({{\rm e}^{i \left ( fx+e \right ) }} \right ) }{{f}^{3}}}-2\,{\frac{ab{d}^{2}\ln \left ({{\rm e}^{2\,i \left ( fx+e \right ) }}+1 \right ){x}^{2}}{f}}-{\frac{{\frac{8\,i}{3}}ba{d}^{2}{e}^{3}}{{f}^{3}}}-{\frac{4\,i{b}^{2}{d}^{2}ex}{{f}^{2}}}+{\frac{{a}^{2}{d}^{2}{x}^{3}}{3}}-{\frac{{b}^{2}{d}^{2}{x}^{3}}{3}}+{a}^{2}{c}^{2}x-{b}^{2}{c}^{2}x-{b}^{2}cd{x}^{2}+{\frac{2\,i{b}^{2} \left ({d}^{2}{x}^{2}+2\,cdx+{c}^{2} \right ) }{f \left ({{\rm e}^{2\,i \left ( fx+e \right ) }}+1 \right ) }}+2\,iabcd{x}^{2}-4\,{\frac{b\ln \left ({{\rm e}^{2\,i \left ( fx+e \right ) }}+1 \right ) acdx}{f}}-8\,{\frac{abcde\ln \left ({{\rm e}^{i \left ( fx+e \right ) }} \right ) }{{f}^{2}}}+{\frac{2\,iab{d}^{2}{\it polylog} \left ( 2,-{{\rm e}^{2\,i \left ( fx+e \right ) }} \right ) x}{{f}^{2}}}-{\frac{4\,iba{d}^{2}{e}^{2}x}{{f}^{2}}}+{\frac{4\,ibacd{e}^{2}}{{f}^{2}}}+{\frac{2\,iabcd{\it polylog} \left ( 2,-{{\rm e}^{2\,i \left ( fx+e \right ) }} \right ) }{{f}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)^2*(a+b*tan(f*x+e))^2,x)

[Out]

-I*b^2*d^2*polylog(2,-exp(2*I*(f*x+e)))/f^3-2*I*a*b*c^2*x-a*b*d^2*polylog(3,-exp(2*I*(f*x+e)))/f^3+a^2*c*d*x^2
+8*I*b/f*a*c*d*e*x-2*I*b^2/f^3*d^2*e^2-2*I*b^2/f*d^2*x^2+2/3*I*a*b*d^2*x^3+2*b^2/f^2*d^2*ln(exp(2*I*(f*x+e))+1
)*x-2*b/f*a*c^2*ln(exp(2*I*(f*x+e))+1)+4*b/f*a*c^2*ln(exp(I*(f*x+e)))+2*b^2/f^2*c*d*ln(exp(2*I*(f*x+e))+1)-4*b
^2/f^2*c*d*ln(exp(I*(f*x+e)))+4*b^2/f^3*d^2*e*ln(exp(I*(f*x+e)))+4*b/f^3*a*d^2*e^2*ln(exp(I*(f*x+e)))-2*b/f*a*
d^2*ln(exp(2*I*(f*x+e))+1)*x^2-8/3*I*b/f^3*a*d^2*e^3-4*I*b^2/f^2*d^2*e*x+1/3*a^2*d^2*x^3-1/3*b^2*d^2*x^3+a^2*c
^2*x-b^2*c^2*x-b^2*c*d*x^2+2*I*b^2*(d^2*x^2+2*c*d*x+c^2)/f/(exp(2*I*(f*x+e))+1)+2*I*a*b*c*d*x^2-4*b/f*ln(exp(2
*I*(f*x+e))+1)*a*c*d*x-8*b/f^2*a*c*d*e*ln(exp(I*(f*x+e)))+2*I*b/f^2*a*d^2*polylog(2,-exp(2*I*(f*x+e)))*x-4*I*b
/f^2*a*d^2*e^2*x+4*I*b/f^2*a*c*d*e^2+2*I*b/f^2*a*c*d*polylog(2,-exp(2*I*(f*x+e)))

________________________________________________________________________________________

Maxima [B]  time = 2.39943, size = 1713, normalized size = 7.48 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2*(a+b*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

1/3*(3*(f*x + e)*a^2*c^2 + (f*x + e)^3*a^2*d^2/f^2 - 3*(f*x + e)^2*a^2*d^2*e/f^2 + 3*(f*x + e)*a^2*d^2*e^2/f^2
 + 3*(f*x + e)^2*a^2*c*d/f - 6*(f*x + e)*a^2*c*d*e/f + 6*a*b*c^2*log(sec(f*x + e)) + 6*a*b*d^2*e^2*log(sec(f*x
 + e))/f^2 - 12*a*b*c*d*e*log(sec(f*x + e))/f + 3*((2*a*b + I*b^2)*(f*x + e)^3*d^2 + 6*b^2*d^2*e^2 - 12*b^2*c*
d*e*f + 6*b^2*c^2*f^2 - ((6*a*b + 3*I*b^2)*d^2*e - (6*a*b + 3*I*b^2)*c*d*f)*(f*x + e)^2 - (-3*I*b^2*d^2*e^2 +
6*I*b^2*c*d*e*f - 3*I*b^2*c^2*f^2)*(f*x + e) - (6*(f*x + e)^2*a*b*d^2 + 6*b^2*d^2*e - 6*b^2*c*d*f - 6*(2*a*b*d
^2*e - 2*a*b*c*d*f + b^2*d^2)*(f*x + e) + 6*((f*x + e)^2*a*b*d^2 + b^2*d^2*e - b^2*c*d*f - (2*a*b*d^2*e - 2*a*
b*c*d*f + b^2*d^2)*(f*x + e))*cos(2*f*x + 2*e) + (6*I*(f*x + e)^2*a*b*d^2 + 6*I*b^2*d^2*e - 6*I*b^2*c*d*f + (-
12*I*a*b*d^2*e + 12*I*a*b*c*d*f - 6*I*b^2*d^2)*(f*x + e))*sin(2*f*x + 2*e))*arctan2(sin(2*f*x + 2*e), cos(2*f*
x + 2*e) + 1) + ((2*a*b + I*b^2)*(f*x + e)^3*d^2 - (6*b^2*d^2 + (6*a*b + 3*I*b^2)*d^2*e - (6*a*b + 3*I*b^2)*c*
d*f)*(f*x + e)^2 - (-3*I*b^2*d^2*e^2 - 3*I*b^2*c^2*f^2 - 12*b^2*d^2*e - 6*(-I*b^2*c*d*e - 2*b^2*c*d)*f)*(f*x +
 e))*cos(2*f*x + 2*e) + (6*(f*x + e)*a*b*d^2 - 6*a*b*d^2*e + 6*a*b*c*d*f - 3*b^2*d^2 + 3*(2*(f*x + e)*a*b*d^2
- 2*a*b*d^2*e + 2*a*b*c*d*f - b^2*d^2)*cos(2*f*x + 2*e) - (-6*I*(f*x + e)*a*b*d^2 + 6*I*a*b*d^2*e - 6*I*a*b*c*
d*f + 3*I*b^2*d^2)*sin(2*f*x + 2*e))*dilog(-e^(2*I*f*x + 2*I*e)) - (-3*I*(f*x + e)^2*a*b*d^2 - 3*I*b^2*d^2*e +
 3*I*b^2*c*d*f + (6*I*a*b*d^2*e - 6*I*a*b*c*d*f + 3*I*b^2*d^2)*(f*x + e) + (-3*I*(f*x + e)^2*a*b*d^2 - 3*I*b^2
*d^2*e + 3*I*b^2*c*d*f + (6*I*a*b*d^2*e - 6*I*a*b*c*d*f + 3*I*b^2*d^2)*(f*x + e))*cos(2*f*x + 2*e) + 3*((f*x +
 e)^2*a*b*d^2 + b^2*d^2*e - b^2*c*d*f - (2*a*b*d^2*e - 2*a*b*c*d*f + b^2*d^2)*(f*x + e))*sin(2*f*x + 2*e))*log
(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1) - (-3*I*a*b*d^2*cos(2*f*x + 2*e) + 3*a*b*d^
2*sin(2*f*x + 2*e) - 3*I*a*b*d^2)*polylog(3, -e^(2*I*f*x + 2*I*e)) - ((-2*I*a*b + b^2)*(f*x + e)^3*d^2 + (6*I*
b^2*d^2 - 3*(-2*I*a*b + b^2)*d^2*e - 3*(2*I*a*b - b^2)*c*d*f)*(f*x + e)^2 + (3*b^2*d^2*e^2 + 3*b^2*c^2*f^2 - 1
2*I*b^2*d^2*e - (6*b^2*c*d*e - 12*I*b^2*c*d)*f)*(f*x + e))*sin(2*f*x + 2*e))/(-3*I*f^2*cos(2*f*x + 2*e) + 3*f^
2*sin(2*f*x + 2*e) - 3*I*f^2))/f

________________________________________________________________________________________

Fricas [C]  time = 1.77835, size = 1081, normalized size = 4.72 \begin{align*} \frac{2 \,{\left (a^{2} - b^{2}\right )} d^{2} f^{3} x^{3} + 6 \,{\left (a^{2} - b^{2}\right )} c d f^{3} x^{2} + 6 \,{\left (a^{2} - b^{2}\right )} c^{2} f^{3} x - 3 \, a b d^{2}{\rm polylog}\left (3, \frac{\tan \left (f x + e\right )^{2} + 2 i \, \tan \left (f x + e\right ) - 1}{\tan \left (f x + e\right )^{2} + 1}\right ) - 3 \, a b d^{2}{\rm polylog}\left (3, \frac{\tan \left (f x + e\right )^{2} - 2 i \, \tan \left (f x + e\right ) - 1}{\tan \left (f x + e\right )^{2} + 1}\right ) +{\left (-6 i \, a b d^{2} f x - 6 i \, a b c d f + 3 i \, b^{2} d^{2}\right )}{\rm Li}_2\left (\frac{2 \,{\left (i \, \tan \left (f x + e\right ) - 1\right )}}{\tan \left (f x + e\right )^{2} + 1} + 1\right ) +{\left (6 i \, a b d^{2} f x + 6 i \, a b c d f - 3 i \, b^{2} d^{2}\right )}{\rm Li}_2\left (\frac{2 \,{\left (-i \, \tan \left (f x + e\right ) - 1\right )}}{\tan \left (f x + e\right )^{2} + 1} + 1\right ) - 6 \,{\left (a b d^{2} f^{2} x^{2} + a b c^{2} f^{2} - b^{2} c d f +{\left (2 \, a b c d f^{2} - b^{2} d^{2} f\right )} x\right )} \log \left (-\frac{2 \,{\left (i \, \tan \left (f x + e\right ) - 1\right )}}{\tan \left (f x + e\right )^{2} + 1}\right ) - 6 \,{\left (a b d^{2} f^{2} x^{2} + a b c^{2} f^{2} - b^{2} c d f +{\left (2 \, a b c d f^{2} - b^{2} d^{2} f\right )} x\right )} \log \left (-\frac{2 \,{\left (-i \, \tan \left (f x + e\right ) - 1\right )}}{\tan \left (f x + e\right )^{2} + 1}\right ) + 6 \,{\left (b^{2} d^{2} f^{2} x^{2} + 2 \, b^{2} c d f^{2} x + b^{2} c^{2} f^{2}\right )} \tan \left (f x + e\right )}{6 \, f^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2*(a+b*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

1/6*(2*(a^2 - b^2)*d^2*f^3*x^3 + 6*(a^2 - b^2)*c*d*f^3*x^2 + 6*(a^2 - b^2)*c^2*f^3*x - 3*a*b*d^2*polylog(3, (t
an(f*x + e)^2 + 2*I*tan(f*x + e) - 1)/(tan(f*x + e)^2 + 1)) - 3*a*b*d^2*polylog(3, (tan(f*x + e)^2 - 2*I*tan(f
*x + e) - 1)/(tan(f*x + e)^2 + 1)) + (-6*I*a*b*d^2*f*x - 6*I*a*b*c*d*f + 3*I*b^2*d^2)*dilog(2*(I*tan(f*x + e)
- 1)/(tan(f*x + e)^2 + 1) + 1) + (6*I*a*b*d^2*f*x + 6*I*a*b*c*d*f - 3*I*b^2*d^2)*dilog(2*(-I*tan(f*x + e) - 1)
/(tan(f*x + e)^2 + 1) + 1) - 6*(a*b*d^2*f^2*x^2 + a*b*c^2*f^2 - b^2*c*d*f + (2*a*b*c*d*f^2 - b^2*d^2*f)*x)*log
(-2*(I*tan(f*x + e) - 1)/(tan(f*x + e)^2 + 1)) - 6*(a*b*d^2*f^2*x^2 + a*b*c^2*f^2 - b^2*c*d*f + (2*a*b*c*d*f^2
 - b^2*d^2*f)*x)*log(-2*(-I*tan(f*x + e) - 1)/(tan(f*x + e)^2 + 1)) + 6*(b^2*d^2*f^2*x^2 + 2*b^2*c*d*f^2*x + b
^2*c^2*f^2)*tan(f*x + e))/f^3

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan{\left (e + f x \right )}\right )^{2} \left (c + d x\right )^{2}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)**2*(a+b*tan(f*x+e))**2,x)

[Out]

Integral((a + b*tan(e + f*x))**2*(c + d*x)**2, x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (d x + c\right )}^{2}{\left (b \tan \left (f x + e\right ) + a\right )}^{2}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2*(a+b*tan(f*x+e))^2,x, algorithm="giac")

[Out]

integrate((d*x + c)^2*(b*tan(f*x + e) + a)^2, x)